<?php

namespace app\common\model;
/**
 * [Gather  义工管理表]
 * @author [C。]
 * @return html
 */
class Gather extends Base
{
    protected $name = 'gather';
    /**
     * 根据搜索条件获取列表信息
     */
    public function getList($map, $from=0, $size = 5)
    {
        $order = ['id' => 'desc'];
        $result =  $this->field('id,title,name,phone,city,addr,starttime,endtime,maxnum,content,addtime,type,cover')
            ->where($map)
            ->limit($from, $size)
            ->order($order)
            ->select();

        return $result;
    }
    /**
     * 根据条件来获取列表的数据的总数
     * @param array $param
     */
    public function getCount($map = []) {
        $result =  $this->where($map)->count();
        return $result;
    }
}
